<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>使用：在一个元素之前插入一些内容</title>
    <style>
        h1::before {
            content: url('https://www.runoob.com/try/demo_source/smiley.gif');
        }
    </style>
</head>

<body>
    <h1>This is a heading</h1>
    <p>The :before pseudo-element inserts content before an element.</p>
    <h1>This is a heading</h1>
    <p><b>注意:</b>仅当 !DOCTYPE 已经声明 IE8 支持这个内容属性</p>
</body>

</html>